﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Rhsoft.SqlServer.MetadataManager
{
    public partial class EditPropertyForm : Form
    {
        public string OldName { get; set; }
        public string NewName { get; set; }
        public string OldValue{ get; set; }
        public string NewValue { get; set; }
        public bool IsCancel { get; set; }
        public EditPropertyForm( )
        {
            InitializeComponent( );
        }
        
        private void bChange_Click( object sender, EventArgs e )
        {
            this.OldName = fOldName.Text;
            this.NewName = fNewName.Text;
            this.OldValue = fOldName.Text;
            this.NewValue = fNewValue.Text;
            this.IsCancel = false;
            this.Close( );
            this.Dispose( );
        }

        private void bCancel_Click( object sender, EventArgs e )
        {
            this.IsCancel = true;
            this.Close( );
            this.Dispose( );
        }

        private void fCheckValues_CheckedChanged( object sender, EventArgs e )
        {
            if( fCheckValues.Checked )
            {
                this.fOldValue.Enabled = true;
                this.fNewValue.Enabled = true;
            }
            else
            {
                this.fOldValue.Enabled = false;
                this.fNewValue.Enabled = false;
            }
        }
        private void fCheckNames_CheckedChanged( object sender, EventArgs e )
        {
            if( fCheckNames.Checked )
            {
                this.fOldName.Enabled = true;
                this.fNewName.Enabled = true;
            }
            else
            {
                this.fOldName.Enabled = false;
                this.fNewName.Enabled = false;
            }
        }

    }
}
